home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / program / eflibpt4.zip / DEMO / STRINGS / STRING1.PAS < prev    next >
Pascal/Delphi Source File  |  1996-07-20  |  839b  |  26 lines

  1. { Borland Pascal Extended Function Library - EFLIB (C) Johan Larsson, 1996
  2.   Demonstration; basic string handling #1
  3.  
  4.   EFLIB IS PROTECTED BY THE COPYRIGHT LAW AND MAY NOT BE COPIED, SOLD OR
  5.   MANIPULATED. FOR MORE INFORMATION, SEE PROGRAM MANUAL! THIS DEMONSTRAT-
  6.   ION PROGRAM MAY FREELY BE USED AND DISTRIBUTED.                          }
  7.  
  8.  
  9. uses EFLIBTXT;
  10.  
  11. var String1, String2 : string;
  12.  
  13.  
  14. begin
  15.      String1 := 'To be, or not to be: that is the question.';
  16.      String2 := 'question';
  17.  
  18.      { Write the original string }
  19.      WriteLn (String1);
  20.  
  21.      { Write a string with "question" replaced with "problem" }
  22.      WriteLn (StringReplace(String1, String2, 'problem'));
  23.  
  24.      { Write the position of "be" in string, starting from the end }
  25.      WriteLn (StringBackwardPos ('be', String1, Length(String1)));
  26. end.